// 父传子
function Son (props) {
  // props: 接收父组件传递过来的参数
  console.log(props);
  return (
    <div>
      <h1>this is son: { props.name }</h1>
      { props.child }
    </div>
  )
}

function App () {
  const name = "this is App";
  return (
    <div>
      <Son
      name={ name }
      age={18}
      sex="男"
      arr={[1,2,3]}
      obj={{a: 1, b: 2}}
      fn={()=> console.log("this is fn")}
      child={<div>this is child</div>}
      ></Son>
    </div>
  )
}
export default App;